<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:p='http://primefaces.org/ui'
      xmlns:h='http://java.sun.com/jsf/html'
      xmlns:cc='http://java.sun.com/jsf/composite'>

<cc:interface>

<cc:attribute name='id'/>

<cc:attribute name='bean'/>

<cc:attribute name='ls'/>

<cc:attribute name='rows' default='10'/>

<cc:attribute name='r' default='#{x.id}'/>

<cc:attribute name='u' default='@(.#{cc.attrs.bean.name})'/>

</cc:interface>


<cc:implementation>

<h:panelGroup id='table'>

<p:dataTable id='tbl' value='#{cc.attrs.ls}' var='x' paginator='true' paginatorPosition='bottom' rows='#{cc.attrs.rows}' resizableColumns='true' rendered='#{not empty cc.attrs.ls}'

             paginatorAlwaysVisible='false' emptyMessage='' selection='#{cc.attrs.bean.entitySel}' selectionMode='single' rowKey='#{cc.attrs.r}'

             filteredValue='#{cc.attrs.bean.lsFiltered}' style='width:100%'>

  <p:ajax event='rowSelect' listener='#{cc.attrs.bean.detailEdit}' update='#{cc.attrs.u}'/>

  <cc:insertChildren/>

  <p:column style='width: 40px'>

  <p:commandButton icon='ui-icon-trash' style='border: none; background: transparent' actionListener='#{cc.attrs.bean.detailDelete(x)}' update='#{cc.attrs.u}'/>

  </p:column>

</p:dataTable>

</h:panelGroup>

</cc:implementation>

</html>
